/*
 * @Author: YeMiao 
 * @Date: 2018-02-09 16:33:21 
 * @Last Modified by: YeMiao
 * @Last Modified time: 2018-03-05 09:10:44
 */
import { NgModule } from '@angular/core';
import { RouterModule, Routes, CanActivate  } from '@angular/router';
import { AuthGuard } from './auth/auth.guard';

const appRoutes: Routes = [
  { path: '', redirectTo:'main', pathMatch:'full' },
  { path: 'main', canActivate: [AuthGuard], loadChildren: './main/main.module#MainModule' },
  { path: 'login', loadChildren: './login/login.module#LoginModule' }
];

@NgModule({
  imports: [
    RouterModule.forRoot(appRoutes,{ enableTracing: false })
  ],
  exports: [
    RouterModule
  ]
})
export class AppRouterModule {}
